/**
 * Configurations
 * @author Wangtd
 */
const paths = require('./lib/util.js').paths;

module.exports = {
    debug: true,
    port: 8181,
    workDir: paths('./work'),
    mockDir: paths('./work/mock'),
    blogDir: paths('./work/blog'),
    security: {
        admins: [],
        mailDomain: '@',
        allowedHosts: ['127.0.0.1']// false
    },
    proxy: {
        port: {
            offset: 8181,
            ranges: [8181, 9191]
        },
        enabled: true
    },
    sessionConfig: {
        secret: 'mockcat',
        cookie: { maxAge: 120 * 60 * 1000 },// 120 minutes
        resave: false,
        saveUninitialized: true
    },
    mailConfig: {
        host: 'smtp.qq.com',
        secureConnection: true,
        auth: {
            user: 'example@qq.com',
            pass: 'secret'
        }
    },
    logConfig: {
        appenders: {
            'console': { type: 'console' },
            'logfile': {
                type: 'file',
                filename: './logs/stdout.log',
                maxLogSize: 10485760,
                backups: 10,
                encoding: 'utf-8'
            }
        },
        categories: {
            'default': {
                appenders: ['console', 'logfile'],
                level: 'info'
            }
        }
    }
};
